AT-NFC  2.1 (win)
AT-NFC kernel set
Functions
nfc_amex_lib.h File Reference

Go to the source code of this file.

Functions

KER_RES KER_API amexNfcInit (KER_CTX_INIT_PARAM const KER_VOID *pConfigID, KER_INT16U usConfigIDLen, const KER_CHAR *pchKernelFiles, KER_INT16U usKernelFilesLen)
 Performs kernel initialization. More...
 
KER_RES KER_API amexNfcDeInit (KER_CTX_SINGLE_PARAM)
 Performs kernel de-initialization. More...
 
KER_BOOL KER_API amexNfcVerInfo (KER_CTX_PARAM const KER_CHAR **ppchEmvVer, KER_INT16U *pusEmvVerLen, const KER_CHAR **ppchLibVer, KER_INT16U *pusLibVerLen)
 Obtains emv kernel library version info. More...
 
KER_INT16U KER_API amexNfcTran (KER_CTX_PARAM const NFC_EP_PRE_DATA *pEpPRE, const NFC_EP_PPSE_DATA *pEpPPSE, const NFC_EP_TRAN_DATA *pEpTranData, KER_TRAN **ppTran, NFC_OUTCOME **ppOutcome)
 Initiates transaction bprocessing by kernel. More...
 
KER_RES KER_API amexNfcTranIssUpdate (KER_CTX_PARAM KER_TRAN *pTran, const NFC_EP_RESTART_DATA *pEpRestartData, const NFC_EXT_TERM_RESTART_DATA *pTermRestartData, NFC_OUTCOME **ppOutcome)
 Process auth request result. More...
 
KER_BOOL KER_API amexNfcTranRelease (KER_CTX_PARAM KER_TRAN *pTran)
 Releases NFC Transaction container structure. More...
 
KER_RES KER_API amexNfcGetData (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, KER_BYTE *pbtData, KER_INT16U *pusDataLen)
 Transaction data request. More...
 
KER_RES KER_API amexNfcGetDataByTag (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, const KER_BYTE *pbtTag, KER_BYTE btTagSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
 transaction data request More...
 
KER_RES KER_API amexNfcGetDataByTagList (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOptions, const KER_BYTE *pbtTagList, KER_INT16U usTagListSize, KER_BYTE *pbtData, KER_INT16U *pusDataSize)
 transaction data request More...
 
KER_BOOL KER_API amexCheckOption (KER_CTX_PARAM KER_TRAN *pTran, KER_INT16U usOption, KER_INT16U usParam, KER_VOID *pParam)
 Check options callback Define this function outside the lib to provide kernel options. More...
 

Detailed Description

NFC AmEx KERNEL library export functions (with uniqe names to link several kernel libs in one project)

Function Documentation

◆ amexCheckOption()

KER_BOOL KER_API amexCheckOption ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOption,
KER_INT16U  usParam,
KER_VOID pParam 
)

Check options callback Define this function outside the lib to provide kernel options.

Parameters
[in]pTran- pointer to the transaction structure (obtained by amexNfcTran)
[in]usOption- option to check (NFC_KER_OPT_DEBUG, NFC_KER_OPT_RRP)
[in]usParam- reserved.
[in]pParam- reserved.
Returns
KER_TRUE - option enabled
KER_FALSE - option disabled

◆ amexNfcDeInit()

KER_RES KER_API amexNfcDeInit ( KER_CTX_SINGLE_PARAM  )

Performs kernel de-initialization.

Returns
KER_OK Success.
Other - failure.

Terminal Application should de-init kernel by this function

Warning
Do not call this function if amexNfcInit failed.

◆ amexNfcGetData()

KER_RES KER_API amexNfcGetData ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
KER_BYTE pbtData,
KER_INT16U pusDataLen 
)

Transaction data request.

call this function to obtain transaction data from kernel (as a flat TLV with all data available)

Parameters
[in]pTran- pointer to the transaction structure (obtained by amexNfcTran)
[in]usOptions- get options (bitmask), reserved
[out]pbtData- Buffer to obtain transaction data (in TLV) (path KER_NULL if you need to calculate tran data length only)
[in,out]pusDataLen- Size of Buffer pbtData as input, data length as output
Returns
KER_OK Success
Other Failure

◆ amexNfcGetDataByTag()

KER_RES KER_API amexNfcGetDataByTag ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
const KER_BYTE pbtTag,
KER_BYTE  btTagSize,
KER_BYTE pbtData,
KER_INT16U pusDataSize 
)

transaction data request

call this function to obtain transaction data by tag from kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by amexNfcTran)
[in]usOptions- get options (bitmask), reserved
[in]pbtTag- buffer with tag value
[in]btTagSize- pbtTag value length
[out]pbtData- buffer to obtain provided tag value
[in,out]pusDataSize- pbtData buffer size as input, output containes result data length
Returns
KER_OK Success
KER_ERR_COMMON_NOT_FOUND Tag not found
Other Failure

◆ amexNfcGetDataByTagList()

KER_RES KER_API amexNfcGetDataByTagList ( KER_CTX_PARAM KER_TRAN pTran,
KER_INT16U  usOptions,
const KER_BYTE pbtTagList,
KER_INT16U  usTagListSize,
KER_BYTE pbtData,
KER_INT16U pusDataSize 
)

transaction data request

call this function to obtain transaction data by tag list from kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by amexNfcTran)
[in]usOptions- get options (bitmask), reserved
[in]pbtTagList- buffer with tag list
[in]usTagListSize- pbtTagList value length
[out]pbtData- buffer to obtain provided tag list in TLV format
[in,out]pusDataSize- pbtData buffer size as input, output containes result data length
Returns
KER_OK Success
Other Failure

◆ amexNfcInit()

KER_RES KER_API amexNfcInit ( KER_CTX_INIT_PARAM const KER_VOID pConfigID,
KER_INT16U  usConfigIDLen,
const KER_CHAR pchKernelFiles,
KER_INT16U  usKernelFilesLen 
)

Performs kernel initialization.

Parameters
[in]pConfigIDBuffer with configuration ID obtained from Terminal Application (in HAL recognized format)
[in]usConfigIDLenpConfigID buffer length
[in]pchKernelFilesbuffer with kernel binary file names (for checksum calculation) - set of nul terminated strings ended by nul.
[in]usKernelFilesLenlength of pchKernelFiles including nul-terminating sym
Returns
KER_OK Success.
Other - failure.

Terminal Application should init kernel by this function before calling any other kernel functions

Warning
If amexNfcInit returns KER_OK, Terminal Application should call amexNfcDeInit finally to release allocated resources.

◆ amexNfcTran()

KER_INT16U KER_API amexNfcTran ( KER_CTX_PARAM const NFC_EP_PRE_DATA pEpPRE,
const NFC_EP_PPSE_DATA pEpPPSE,
const NFC_EP_TRAN_DATA pEpTranData,
KER_TRAN **  ppTran,
NFC_OUTCOME **  ppOutcome 
)

Initiates transaction bprocessing by kernel.

This function initiates NFC transaction processing by kernel, based on Select command results (from EP)

Parameters
[in]pEpPRE- Entry Point preprocesing data
[in]pEpPPSE- Entry Point selected aid related PPSE data
[in]pEpTranData- transaction data maintained by Entry Point
[out]ppTran- pointer to created transaction structure
[out]ppOutcome- pointer to obtain transaction outcome
Returns
KER_OK Success, see outcome for details.
KER_ERR_COMMON_CARD_HW_ERR Card communication failure - abort transaction
Other errors (Kernel Error Codes) Failure - abort transaction.
Warning
When tranaction context (ppTran) no longer required call amexNfcTranRelease. Do it despite of result code retuned.

◆ amexNfcTranIssUpdate()

KER_RES KER_API amexNfcTranIssUpdate ( KER_CTX_PARAM KER_TRAN pTran,
const NFC_EP_RESTART_DATA pEpRestartData,
const NFC_EXT_TERM_RESTART_DATA pTermRestartData,
NFC_OUTCOME **  ppOutcome 
)

Process auth request result.

This function processes auth request result by kernel

Parameters
[in]pTran- pointer to the transaction structure (obtained by visaNfcTran)
[in]pEpRestartData- Entry Point transaction restart data (last FCI)
[in]pTermRestartData- Terminal transaction restart data (issuer update data assumed)
[out]ppOutcome- pointer to obtain transaction outcome
Returns
NFC_INF_OUTCOME Success, see outcome for details.
NFC_INF_INV_COMM_SEQUESNCE Auth request result unexpected.
Other errors (Kernel Error Codes) Failure - abort transaction.

◆ amexNfcTranRelease()

KER_BOOL KER_API amexNfcTranRelease ( KER_CTX_PARAM KER_TRAN pTran)

Releases NFC Transaction container structure.

Parameters
[in]pTran- pointer to the transaction structure to release (obtained by amexNfcTran)
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param or memory error.

◆ amexNfcVerInfo()

KER_BOOL KER_API amexNfcVerInfo ( KER_CTX_PARAM const KER_CHAR **  ppchEmvVer,
KER_INT16U pusEmvVerLen,
const KER_CHAR **  ppchLibVer,
KER_INT16U pusLibVerLen 
)

Obtains emv kernel library version info.

Parameters
[out]ppchEmvVerpointer to obtain reference to Kernel Specification version info (optional, set KER_NULL if you don't need it)
[out]pusEmvVerLenlength of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it)
[out]ppchLibVerpointer to obtain reference to kernel library version info (optional, set KER_NULL if you don't need it)
[out]pusLibVerLenlength of data, including nul-terminated symbol (optional, set KER_NULL if you don't need it)
Returns
KER_TRUE Success.
KER_FALSE Failure. Execution failed due to invalid param.